package controllers

import (
	"flashapi/models"
	"github.com/astaxie/beego"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Get() {
	c.Data["Website"] = "beego.me"
	c.Data["Email"] = "astaxie@gmail.com"
	c.TplName = "index.tpl"
}



func (c *MainController) GetOne() {
	//user, err := models.KeyWordOne(80809)
	user, err := models.KeyWordOne(1)
	if user == nil || err != nil {
		//c.pageError("数据无效，请刷新后重试")
	}
	c.Data["json"] = user
	c.ServeJSON()
}
func (c *MainController) GetAll() {
	c.Data["json"] = models.KeywordAll()
	c.ServeJSON()
}